//
//  FMAntorDescTableViewCell.m
//  PsychologyFM
//
//  Created by 杜建虎 on 16/1/14.
//  Copyright © 2016年 ZhangLuDu. All rights reserved.
//

#import "FMAntorDescTableViewCell.h"
#import <UIImageView+WebCache.h>
@implementation FMAntorDescTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _iconImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, kScreenWidth / 7, kScreenWidth / 7)];
        [self.contentView addSubview:_iconImage];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.iconImage.frame.size.width + 20, 15, kScreenWidth - self.iconImage.frame.size.width - 20, 20)];
        _titleLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_titleLabel];
        
        _listenLabel = [[UILabel alloc] initWithFrame:CGRectMake(_titleLabel.frame.origin.x,_titleLabel.frame.origin.y + _titleLabel.frame.size.height + 8,kScreenWidth / 3,15)];
        _listenLabel.textColor = [UIColor grayColor];
        _listenLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_listenLabel];
    }
    return self;
}

- (void)setModel:(FMAntorDescTwoModel *)model
{
    _model = model;
    _titleLabel.text = model.title;
    [_iconImage sd_setImageWithURL:[NSURL URLWithString:model.cover] placeholderImage:nil];;
    _listenLabel.text = [NSString stringWithFormat:@"收听: %@",model.viewnum];
}

@end
